const express = require("express");
const { getMessagePagingService, createMessageService, deleteMessageService } = require("../service/messageService");
const router = express.Router();

router.get("/", async (req, res, next) => {
    res.send(await getMessagePagingService(req.query));
})

router.post("/", async (req, res, next) => {
    res.send(await createMessageService(req.body));
})

router.delete("/:id", async (req, res, next) => {
    res.send(await deleteMessageService(req.params.id));
})

module.exports = router;